package com.school.lab.dao.impl;

import org.hibernate.Query;

import com.school.lab.common.dao.impl.GenericDaoHibernateImpl;
import com.school.lab.dao.RoleDao;
import com.school.lab.domain.Role;


public class RoleDaoImpl extends GenericDaoHibernateImpl<Role, Long> implements RoleDao {

	
	public Role getRoleByName(String name) {
		StringBuffer hql = new StringBuffer();
		hql.append( "from Role r  where r.name=:name");
		Query query = getSession().createQuery(hql.toString());
		query.setString("name", name);
		return (Role) query.uniqueResult();
	}

}
